package cn.boge.hrm;


import org.junit.Test;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class test {
    @Test
    public void test() throws Exception{
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        String encode1 = bCryptPasswordEncoder.encode("123");
        String encode2 = bCryptPasswordEncoder.encode("123");
        //$2a$10$PI0P0hJxben2c8f5vaiiQ.et4R9Vi5bSCnoTnFcR4OIt.1S4oLR5m
        //$2a$10$N3T/C6ALZ1IIefgmVscFLettsdfJD05U7ZXlHTwt1wFv0SiS8Qp8G
        System.out.println(encode1);
        System.out.println(encode2);
    }
    @Test
    public void test1() throws Exception{
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        boolean matches1 = bCryptPasswordEncoder.matches("123", "$2a$10$PI0P0hJxben2c8f5vaiiQ.et4R9Vi5bSCnoTnFcR4OIt.1S4oLR5m");
        boolean matches2 = bCryptPasswordEncoder.matches("123", "$2a$10$N3T/C6ALZ1IIefgmVscFLettsdfJD05U7ZXlHTwt1wFv0SiS8Qp8G");
        System.out.println(matches1);
        System.out.println(matches2);
    }
}
